<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"DD-3-3");
$colname_edit = "-1";
if (isset($_GET['id'])) {
  $colname_edit = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_con_gl, $con_gl);
$query_edit = sprintf("SELECT * FROM gl_gol WHERE id = %s", $colname_edit);
$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
$totalRows_edit = mysql_num_rows($edit);
?><script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#delete').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
$(function()
  {
      $('#keterangan').wysiwyg();
  });
</script>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Hapus Golongan Aset  </h1>
<form action="proses/golonganaset.php?act=delete" method="POST" name="delete" class="niceform" id="delete">
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF" class="datatable">
    <tr>
      <td width="21%" align="right">Golongan*  : </td>
      <td width="79%"><label>
        <input name="golongan" type="text" id="golongan" value="<?php echo $row_edit['golongan']; ?>" size="30" maxlength="100" onFocus="this.blur();"/>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Umur* : </td>
      <td><label>
        <input name="umur" type="text" id="umur" value="<?php echo $row_edit['jangka']; ?>" size="10" maxlength="3" onFocus="this.blur();"/>
      tahun (number only) </label></td>
    </tr>
    <tr valign="top">
      <td align="right">Bobot* : </td>
      <td><label> 
        <input name="bobot" type="text" id="bobot" value="<?php echo $row_edit['bobot']; ?>" size="10" maxlength="4" onFocus="this.blur();"/>
      persen (%) (number only) </label></td>
    </tr>
    <tr>
      <td align="right">Metode : </td>
      <td><label>
        <select name="metode" id="metode" onFocus="this.blur();">
          <option value="0" selected="selected" <?php if (!(strcmp(0, $row_edit['metode']))) {echo "selected=\"selected\"";} ?>>Tanpa Penyusutan (No Depreciation)</option>
          <option value="1" <?php if (!(strcmp(1, $row_edit['metode']))) {echo "selected=\"selected\"";} ?>>Garis Lurus (Straight Line)</option>
        </select>
      </label></td>
    </tr>
    <tr>
      <td align="left"><label><em>*Harus diisi</em></label></td>
      <td><label>
        <input name="Save" type="submit" id="Save" value="Hapus" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onClick="javascript:history.go(-1);">
        </label></td>
    </tr>
  </table>
  <input name="id" type="hidden" id="id" value="<?php echo $row_edit['id']; ?>" />
</form>
<?php
mysql_free_result($edit);
?>
